<template>
  <Header :style="{padding: 0}" class="layout-header-bar">
    <Row type="flex" justify="space-between" align="middle" :style="{margin: '0 20px'}">
      <div type="flex" justify="center"  align="middle">
        <Icon type="md-menu" size="24" @click="headerOpen"></Icon>
        <Icon type="md-arrow-round-up" size="24" @click="handleBack"></Icon> 
      </div>

      <!-- <Button @click="bb" type="primary">Open</Button> -->
      <div>
        超级管理员
        <span class="logout" @click="logout">退出</span>
      </div>
    </Row>
  </Header>
</template>

<script>
export default {
  data() {
    return {
      value2: "子組件"
    };
  },
  methods: {
    logout() {
      this.$axios({
        url: "/admin/account/logout",
        withCredentials: true
      }).then(res => {
        if (res.data.status === 0) {
          // sessionStorage.setItem("islogin","nologin")
          this.$router.replace("/login");
        }
        console.log(res)
      });
    },
    handleBack() {
      this.$router.back();
    },
    headerOpen() {
      this.$emit("menuOpen", this.value2);
      // console.log(this.value2)
    }
  }
};
</script>

<style scoped>
.layout-header-bar {
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  padding: 0 20px;
}
.logout {
  color: skyblue;
  cursor: pointer;
}
</style>
